<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>选择菜单</title>
    <script src="../../lib/jquery/jquery-3.0.0.min.js"></script>
    <script src="../../lib/layui/layui.js" charset="utf-8"></script>
    <script src="../../static/js/app.js"></script>
    <link rel="stylesheet" href="../../static/css/font.css">
<link rel="stylesheet" href="../../lib/layui/css/layui.css">
    <link rel="stylesheet" href="../../static/css/weadmin.css">
    <link rel="stylesheet" href="../../lib/ztree/css/metroStyle/metroStyle.css">
    <script src="../../lib/xm-select/xm-select.js"></script>
    <script src="../../lib/ztree/js/jquery.ztree.all.min.js"></script>
</head>
<body>
<!-- 选择菜单 -->
<div id="menuLayer"  >
    <ul id="menuTree" class="ztree"></ul>
</div>
<script type="text/javascript">
        var setting = {
            data: {
                simpleData: {
                    enable: true,
                    idKey: "id",
                    pIdKey: "pid",
                    rootPId: -1
                },
                key: {
                    url:"nourl"
                }
            }
        };
        //加载菜单树
        var ztree ;

        new APIRequest(
            {
                url: global.api_url + "/sysPermission/selectAll",
                header: {content_type: "application/json;charset=UTF-8",Authorization:getUser().token},
                method: "Post",
                async: false,
                success: function (result) {
                    ztree = $.fn.zTree.init($("#menuTree"), setting,result.data.records);
                },
                dataType: "json"
            }
        );
</script>
</body>
</html>